package com.zenith.middleware.feign.article;

import com.zenith.common.annotation.request.SecurePostMapping;
import com.zenith.common.result.Result;
import com.zenith.common.result.PageResult;
import com.zenith.middleware.po.dto.article.*;
import com.zenith.middleware.po.vo.article.*;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 文章服务Feign客户端
 */
@FeignClient(url = "",name = "zenith-article-service", contextId = "middleware-article-client")
public interface ArticleServiceFeignClient {
    
    // =========================== 文章管理相关接口 ===========================
    
    /**
     * 分页查询文章
     */
    @Operation(summary = "分页查询文章")
    @SecurePostMapping("/getArtArticlePage")
    Result<PageResult<ArtArticleVO>> getArtArticlePage(ArtArticleDTO query);
    
    /**
     * 创建文章
     */
    @Operation(summary = "创建文章")
    @SecurePostMapping("/createArtArticle")
    Result<Boolean> createArtArticle(@RequestBody ArtArticleDTO articleDTO);

    /**
     * 更新文章
     */
    @Operation(summary = "更新文章")
    @SecurePostMapping("/updateArtArticle")
    Result<Boolean> updateArtArticle(@RequestBody ArtArticleDTO articleDTO);

    /**
     * 删除文章
     */
    @Operation(summary = "删除文章")
    @SecurePostMapping("/deleteArtArticle/{id}")
    Result<Boolean> deleteArtArticle(@PathVariable("id") Long id);

    /**
     * 发布文章
     */
    @Operation(summary = "发布文章")
    @SecurePostMapping("/publishArtArticle/{id}/publish")
    Result<Boolean> publishArtArticle(@PathVariable("id") Long id);

    /**
     * 获取文章详情
     */
    @Operation(summary = "获取文章详情")
    @SecurePostMapping("/getArtArticleDetail/{id}")
    Result<ArtArticleDTO> getArtArticleDetail(@PathVariable("id") Long id);

    // =========================== 文章分类相关接口 ===========================

    /**
     * 分页查询文章分类
     */
    @Operation(summary = "分页查询文章分类")
    @SecurePostMapping("/category/getArtCategoryPage/page")
    Result<PageResult<ArtCategoryVO>> getArtCategoryPage(ArtCategoryDTO query);

    /**
     * 获取分类树结构
     */
    @Operation(summary = "获取分类树结构")
    @SecurePostMapping("/category/getArtCategoryTree/tree")
    Result<ArtCategoryVO> getArtCategoryTree();

    /**
     * 创建文章分类
     */
    @Operation(summary = "创建文章分类")
    @SecurePostMapping("/category/createArtCategory")
    Result<Boolean> createArtCategory(@RequestBody ArtCategoryDTO categoryDTO);

    /**
     * 更新文章分类
     */
    @Operation(summary = "更新文章分类")
    @SecurePostMapping("/category/updateArtCategory")
    Result<Boolean> updateArtCategory(@RequestBody ArtCategoryDTO categoryDTO);

    /**
     * 删除文章分类
     */
    @Operation(summary = "删除文章分类")
    @SecurePostMapping("/category/deleteArtCategory/{id}")
    Result<Boolean> deleteArtCategory(@PathVariable("id") Long id);

    // =========================== 文章评论相关接口 ===========================

    /**
     * 创建文章评论
     */
    @Operation(summary = "创建文章评论")
    @SecurePostMapping("/comment/createArtComment")
    Result<Boolean> createArtComment(@RequestBody ArtCommentVO comment);

    /**
     * 删除文章评论
     */
    @Operation(summary = "删除文章评论")
    @SecurePostMapping("/comment/deleteArtComment/{id}")
    Result<Boolean> deleteArtComment(@PathVariable("id") Long id);

    // =========================== 文章互动相关接口 ===========================

    /**
     * 创建文章互动（点赞、收藏、分享等）
     */
    @Operation(summary = "创建文章互动")
    @SecurePostMapping("/interaction/createArtInteraction")
    Result<Boolean> createArtInteraction(@RequestBody ArtInteractionVO interaction);

    /**
     * 删除文章互动
     */
    @Operation(summary = "删除文章互动")
    @SecurePostMapping("/interaction/deleteArtInteraction/{id}")
    Result<Boolean> deleteArtInteraction(@PathVariable("id") Long id);

    // =========================== 文章标签相关接口 ===========================

    /**
     * 分页查询文章标签
     */
    @Operation(summary = "分页查询文章标签")
    @SecurePostMapping("/tag/getArtTagPage")
    Result<PageResult<ArtTagVO>> getArtTagPage(ArtTagDTO query);

    /**
     * 创建文章标签
     */
    @Operation(summary = "创建文章标签")
    @SecurePostMapping("/tag/createArtTag")
    Result<Boolean> createArtTag(@RequestBody ArtTagDTO tagDTO);

    /**
     * 更新文章标签
     */
    @Operation(summary = "更新文章标签")
    @SecurePostMapping("/tag/updateArtTag")
    Result<Boolean> updateArtTag(@RequestBody ArtTagDTO tagDTO);

    /**
     * 删除文章标签
     */
    @Operation(summary = "删除文章标签")
    @SecurePostMapping("/tag/deleteArtTag/{id}")
    Result<Boolean> deleteArtTag(@PathVariable("id") Long id);

    // =========================== 文章专题相关接口 ===========================

    /**
     * 分页查询文章专题
     */
    @Operation(summary = "分页查询文章专题")
    @SecurePostMapping("/topic/getArtTopicPage")
    Result<PageResult<ArtTopicVO>> getArtTopicPage(ArtTopicDTO query);

    /**
     * 创建文章专题
     */
    @Operation(summary = "创建文章专题")
    @SecurePostMapping("/topic/createArtTopic")
    Result<Boolean> createArtTopic(@RequestBody ArtTopicDTO topicDTO);

    /**
     * 更新文章专题
     */
    @Operation(summary = "更新文章专题")
    @SecurePostMapping("/topic/updateArtTopic")
    Result<Boolean> updateArtTopic(@RequestBody ArtTopicDTO topicDTO);

    /**
     * 删除文章专题
     */
    @Operation(summary = "删除文章专题")
    @SecurePostMapping("/topic/deleteArtTopic/{id}")
    Result<Boolean> deleteArtTopic(@PathVariable("id") Long id);
}